/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upn.sigemfi.ope.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author infzt
 */
@Entity
@Table(name = "OPE_EFECTIVO")
@NamedQueries({@NamedQuery(name = "Efectivo.findAll", query = "SELECT e FROM Efectivo e"), @NamedQuery(name = "Efectivo.findByIdEfectivo", query = "SELECT e FROM Efectivo e WHERE e.idEfectivo = :idEfectivo"), @NamedQuery(name = "Efectivo.findByDenominacion", query = "SELECT e FROM Efectivo e WHERE e.denominacion = :denominacion"), @NamedQuery(name = "Efectivo.findByCantidadBilletes", query = "SELECT e FROM Efectivo e WHERE e.cantidadBilletes = :cantidadBilletes")})
public class Efectivo implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_EFECTIVO", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long idEfectivo;
    @Column(name = "DENOMINACION", length = 50)
    private String denominacion;
    @Column(name = "CANTIDAD_BILLETES")
    private Integer cantidadBilletes;
    @JoinColumn(name = "FID_OPE_MONEDA", referencedColumnName = "ID_MONEDA")
    @ManyToOne(fetch = FetchType.LAZY)
    private Moneda fidOpeMoneda;
    @JoinColumn(name = "FID_OPE_VENTANILLA", referencedColumnName = "ID_VENTANILLA")
    @ManyToOne(fetch = FetchType.LAZY)
    private Ventanilla fidOpeVentanilla;

    public Efectivo() {
    }

    public Efectivo(Long idEfectivo) {
        this.idEfectivo = idEfectivo;
    }

    public Long getIdEfectivo() {
        return idEfectivo;
    }

    public void setIdEfectivo(Long idEfectivo) {
        this.idEfectivo = idEfectivo;
    }

    public String getDenominacion() {
        return denominacion;
    }

    public void setDenominacion(String denominacion) {
        this.denominacion = denominacion;
    }

    public Integer getCantidadBilletes() {
        return cantidadBilletes;
    }

    public void setCantidadBilletes(Integer cantidadBilletes) {
        this.cantidadBilletes = cantidadBilletes;
    }

    public Moneda getFidOpeMoneda() {
        return fidOpeMoneda;
    }

    public void setFidOpeMoneda(Moneda fidOpeMoneda) {
        this.fidOpeMoneda = fidOpeMoneda;
    }

    public Ventanilla getFidOpeVentanilla() {
        return fidOpeVentanilla;
    }

    public void setFidOpeVentanilla(Ventanilla fidOpeVentanilla) {
        this.fidOpeVentanilla = fidOpeVentanilla;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEfectivo != null ? idEfectivo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Efectivo)) {
            return false;
        }
        Efectivo other = (Efectivo) object;
        if ((this.idEfectivo == null && other.idEfectivo != null) || (this.idEfectivo != null && !this.idEfectivo.equals(other.idEfectivo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.ope.be.Efectivo[idEfectivo=" + idEfectivo + "]";
    }
}

